import { get, post, file } from './request';

export default {

    // 文件上传
    saveImg: (data) => file('/api/file/saveImg', data),
    saveCover: (data) => file('/api/file/saveCover', data),

    // 获取分类列表
    getAllWorkClass: (data) => get('/api/workClass/getAllWorkClass', data),

    // 创建分类
    createWorkClass: (data) => post('/api/workClass/createWorkClass', data),

    //删除分类
    deleteWorkClass: (data) => post('/api/workClass/deleteWorkClass', data),

    //修改分类
    updateWorkClass: (data) => post('/api/workClass/updateWorkClass', data),

    // 查询所有文章
    getAllWorks: (data) => get('/api/create/getAllWorks', data),

    // 根据文章id查询文章
    getByWorkId: (data) => get('/api/create/getByWorkId', data),

    // 根据类型id查询列表
    getWorksByTypeId: (data) => post('/api/create/getWorksByTypeId', data),

    // 根据用户id查询文章列表
    getWorksByUserId: (data) => get('/api/create/getWorksByUserId', data),

    // 保存图文
    saveWork: (data) => post('/api/create/saveWork', data),

    //根据文章id修改内容
    updateWorkById: (data) => post('/api/create/updateWorkById', data),

    //根据id删除文章
    deleteWorkById: (data) => post('/api/create/deleteWorkById', data),

    //用户授权
    login:(data)=>post('/api/login',data),
}